<?//pp($attendance)?>
<span id="load" url="<?=image_url('load.gif');?>"></span>
<div class="panel">
<div class="row">
	<div class="large-4 columns">
		<div class="btn-group">
			<a href="<?=site_url('teacher/my_classes');?>" class="confirm btn btn-success"title="are you sure you want to exit from grade creator?">Exit</a>
			<a href="<?=site_url('teacher/advisory_input_grades/'.$hash);?>" class="btn  btn-primary">Grades <i class="icon-g-table icon-g-white"></i></a>
			<a href="<?=site_url('teacher/advisory_input_attendance/'.$hash);?>" class="btn">Attendance <i class="icon-g-calendar icon-g-black"></i></a>
			<a href="<?=site_url('teacher/advisory_input_remarks/'.$hash);?>" class="btn btn-primary">Remarks <i class="icon-comment icon-white"></i></a>
		</div>
	</div>
	<div class="large-4 columns">
	<?if(isset($section_desc)):?>
		<?if($section_desc):?>
			<?$sec = current($section_desc);?>
			<span style="font-weight:bold;font-size:16px;">Section Name:&nbsp;&nbsp;<?=$sec->section_name;?>,</span>
			<span style="font-weight:bold;font-size:16px;">Grade Level:&nbsp;&nbsp;<?=$sec->level_desc;?></span>
		<?endif;?>
	<?endif;?>
	</div>
	<div class="large-4 columns">
		<label>Go to Section</label>
		<?=form_dropdown('sections',$sections,set_value('sections',$hash),'style="width:200px;display:inline-block;" class="redirect-auto" url="'.$current_url.'"');?>
	</div>
</div>
</div>
<div>
<?if($section_exists):?>
	<table class="table">
		<thead>
			<tr>
				<td>Jan</td>
				<td>Feb</td>
				<td>Mar</td>
				<td>Apr</td>
				<td>May</td>
				<td>Jun</td>
				<td>Jul</td>
				<td>Aug</td>
				<td>Sep</td>
				<td>Oct</td>
				<td>Nov</td>
				<td>Dec</td>
			</tr>
		</thead>
		<tbody>
			<?if($attendance):?>
				<?foreach($attendance as $att):?>
					<tr class="info">
						<td colspan="12" style="font-weight:bold;"><?=ucwords(strtolower($att['fullname']));?></td>
					<tr>
					<?if($att['attendance']):?>
						<?$col = $att['attendance']->id?>
						<tr>
						<?foreach($att['attendance'] as $k => $v):?>

							<? if($k !== 'ay_id' AND $k !== 'id' AND $k !== 'e_id'):?>
							<td>
								<span class="loading" style="display:inline-block;"></span>
								<input  style="display:inline-block;width:70%;" type="text" value="<?=$v?>" url="<?=site_url('output/set_student_month_attendance/'.$k.'/'.__link($col));?>" class="ajax-change" orgval="<?=$v;?>" ></td>
							</td>	
							<?endif;?>
						<?endforeach;?>
						</tr>	
					<?else:?>
						<td colspan="5">No Students</td>
					<?endif;?>
				<?endforeach;?>
			<?else:?>
				<tr>
					<td colspan="5">No Students</td>
				</tr>
			<?endif;?>
		</tbody>
	</table>
</div>

<script src="<?=script_url('custom/grades');?>" type="text/javascript"></script>

<?else:?>
	<div class="alert-box secondary">
		Please Select A Section.
	</div>
<?endif;?>
</div>